export default {
  state: {
    name: 'chef',
    age: 111
  },
  mutations: {
    updateData(state,payload) {
      state.name = state.name + payload;
    }
  },
  actions: {
    aUpdateData(context,payload) {
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          context.commit('updateData',payload);
          resolve('success');
        }, 1000)
      })
    }
  },
  getters: {
    ageUpdate(state) {
      return state.age / 2;
    }
  },
}
